package cn.com.fattiger.singleton;
import static java.lang.System.out;

import java.lang.reflect.Constructor;
public class Main {
	public static void main(String[] args) throws Exception, SecurityException{
		EnumSingleton instance1 = EnumSingleton.instance;
		EnumSingleton instance2 = EnumSingleton.instance;
		out.println(instance1 == instance2);
		instance2.test();
		Class<EnumSingleton> classType =  EnumSingleton.class;
//		Constructor<EnumSingleton> constructor = classType.getDeclaredConstructor();
//		constructor.setAccessible(true);
//		EnumSingleton instance3 = constructor.newInstance();
//		out.println(instance3);
		
		Constructor<EnumSingleton> constructor1 = classType.getDeclaredConstructor(String.class,int.class);
		constructor1.setAccessible(true);
		EnumSingleton instance4 = constructor1.newInstance();
		out.println(instance4);
	}
}
